import { defineStore } from 'pinia'

export const useKeepAliveStore = defineStore('keepAlive', {
  state: () => ({
    exclude: [''],
  }),
  actions: {
    addExclude(key: string) {
      // 当数组长度超过5时移除第一个元素
      if (this.exclude.length >= 5) {
        this.exclude.shift()
      }
      this.exclude.push(key)
    },
  },
})
